const {Actor} = require("cqrs");

module.exports = class Topic extends Actor {
    constructor(data) {
        super({
            title: data.title,
            content: data.content
        });
    }

    change(title, content) {
        this.$(title, content);
    }

    get updater() {
        return {
            change(json, event) {
                console.log("json " + json);
                return {
                    title: event.title,
                    content: event.content
                }
            } 
        }
    }
}